package com.yd.app.mapper;

import com.yd.app.mapper.provider.StatisticalProvider;
import com.yd.domain.business.Statistical;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 统计分析Mapper
 * Created by sunxianhui on 2018/3/20.
 */
@Repository
public interface StatisticalMapper {
    /**
     * 根据产品类型分页查询
     * @param statistical
     * @param startRow
     * @param pageSize
     * @return
     */
    @SelectProvider(method = "searchListByType", type = StatisticalProvider.class)
    List<Statistical> getListByType(@Param("statistical") Statistical statistical, @Param("startRow") int startRow, @Param("pageSize") int pageSize);

    /**
     * 根据产品类型查询数量
     * @param statistical
     * @return
     */
    @SelectProvider(method = "searchCountByType", type = StatisticalProvider.class)
    int getCountByType(@Param("statistical") Statistical statistical);

    /**
     * 根据客户类型分页查询
     * @param statistical
     * @param startRow
     * @param pageSize
     * @return
     */
    @SelectProvider(method = "searchListByUser", type = StatisticalProvider.class)
    List<Statistical> getListByUser(@Param("statistical") Statistical statistical, @Param("startRow") int startRow, @Param("pageSize") int pageSize);

    /**
     * 根据客户类型查询数量
     * @param statistical
     * @return
     */
    @SelectProvider(method = "searchCountByUser", type = StatisticalProvider.class)
    int getCountByUser(@Param("statistical") Statistical statistical);
}
